package com.iotechn.unimall.admin.api.warehouse;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.WarehouseDO;
import com.iotechn.unimall.data.model.Page;

import java.util.List;

/**
 * 仓库表
 *
 * @author hct
 * @email 77802226@qq.com
 * @date 2020-03-22 16:07:21
 */
@HttpOpenApi(group = "admin.warehouse", description = "仓库管理")
public interface AdminWarehouseService {

    @HttpMethod(description = "列表", permission = "warehouse:warehouse:list", permissionParentName = "仓库管理", permissionName = "仓库列表")
    public Page<WarehouseDO> list(
            @HttpParam(name = "warehouseName", type = HttpParamType.COMMON, description = "名称", valueDef = "") String warehouseName,
            @HttpParam(name = "warehouseContacts", type = HttpParamType.COMMON, description = "联系人", valueDef = "") String warehouseContacts,
            @HttpParam(name = "warehousePhone", type = HttpParamType.COMMON, description = "联系电话", valueDef = "") String warehousePhone,
            @HttpParam(name = "isMain", type = HttpParamType.COMMON, description = "是否主仓库", valueDef = "") Integer isMain,
            @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态", valueDef = "") Integer status,
            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页长度", valueDef = "20") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "创建", permission = "warehouse:warehouse:create", permissionParentName = "仓库管理", permissionName = "仓库列表")
    public WarehouseDO create(
            @NotNull @HttpParam(name = "warehouseDO", type = HttpParamType.COMMON, description = "") WarehouseDO warehouseDO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "修改", permission = "warehouse:warehouse:update", permissionParentName = "仓库管理", permissionName = "仓库列表")
    public String update(
            @NotNull @HttpParam(name = "warehouseDO", type = HttpParamType.COMMON, description = "") WarehouseDO warehouseDO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "删除", permission = "warehouse:warehouse:delete", permissionParentName = "仓库管理", permissionName = "仓库列表")
    public String delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "删除Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "详情", permission = "warehouse:warehouse:detail", permissionParentName = "仓库管理", permissionName = "仓库列表")
    public WarehouseDO detail(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "更改状态", permission = "warehouse:warehouse:active", permissionParentName = "仓库管理", permissionName = "仓库列表")
    public String updateStatus(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "") Long id,
            @NotNull @HttpParam(name = "status", type = HttpParamType.COMMON, description = "状态") Integer status,

            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "获取所有仓库")
    public List<WarehouseDO> listWareHousesByPara(
            @HttpParam(name = "status") String status,   @HttpParam(name = "isMain", type = HttpParamType.COMMON, description = "主仓库(1:是 0：否 不填代表所有)") Integer isMain
            ,@HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;
}

